package com.ztgf.sys.api.cms;

import com.baomidou.mybatisplus.plugins.Page;
import com.ztgf.common.constant.Result;
import com.ztgf.common.enums.CodeEnum;
import com.ztgf.shopping.models.bo.shop.ShopBlacklistBO;
import com.ztgf.shopping.models.service.shop.IShopBlacklistService;
import com.ztgf.shopping.models.vo.shop.ShopBlacklistVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author YUE
 * @create 2020-07-08 16:34
 */
@RestController
@RequestMapping("/cms/SysBlackList")
@Slf4j
@Api(value = "SysBlackListController",tags = "用户或者店铺黑名单表接口")
public class SysBlackListController {

    @DubboReference
    private IShopBlacklistService shopBlacklistService;

    /**
     * 根据有选择获取黑名单表
     * @return
     */
    @ApiOperation(value = "根据黑名单id移除",notes = "根据黑名单id移除")
    @PostMapping("/deleteByBlackId")
    public Result deleteByBlackId(Long id){
        if(null == id){
            return new Result<>(CodeEnum.FAIL_100002);
        }
        boolean b = shopBlacklistService.deleteById(id);
        if(b){
            return new Result();
        }
        return new Result<>(CodeEnum.FAIL_100001);
    }
}
